UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7dfBO/1c0mv4ZfpVhbcEmo/eff6ODQh1fnsQoUKHmIE=' 
WHERE 
  key_id = '0a12861aa3f705562f751bc713878a3110b354e89fd47d7a870a6f540b9f27ba' 
  AND (
    token = '7dfBO/1c0mv4ZfpVhbcEmo/eff6ODQh1fnsQoUKHmIE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019