UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OEdoT7o9/TuGcxMyGJNhPmltD0ofjhgCE4stC+wCG2w=' 
WHERE 
  key_id = '12a97a764c2bc5a1aad6d339b890fa856fdc5d377cc4dab072cb0e08af4a0bec' 
  AND (
    token = 'OEdoT7o9/TuGcxMyGJNhPmltD0ofjhgCE4stC+wCG2w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019