UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ifK9DoVU8jdW4mnQyDHGyeYhIb0ZzN+LtAiJfxrUjeY=' 
WHERE 
  key_id = '1cf12db76a7f4b5b3251b0ec38a7df83485b634a9ac9aa8ec2f89d74263b16dc' 
  AND (
    token = 'ifK9DoVU8jdW4mnQyDHGyeYhIb0ZzN+LtAiJfxrUjeY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026