UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/ZVkd3ZBR9/rQ5hiFAV0Zgm2NRayGdbd4ryhusRoHg8=' 
WHERE 
  key_id = 'a639beb27b98a8b8b0dacf6373cbc732be210f0442c9b02b61ba59f38cc06843' 
  AND (
    token = '/ZVkd3ZBR9/rQ5hiFAV0Zgm2NRayGdbd4ryhusRoHg8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036