UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mwBTCcqrgvfA2XCOpIkAD28HZ2VPmYd/Jam6fEUv1lw=' 
WHERE 
  key_id = '7443e3a45dbf4dc0a7c64e63964f9bf36ee8921477bd3f3d5eb4b6dac6bc1a75' 
  AND (
    token = 'mwBTCcqrgvfA2XCOpIkAD28HZ2VPmYd/Jam6fEUv1lw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046