UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IQaThhvje3TFmou9AgDdzFhyVq7PVX+dlVbAyZ1Tr0Y=' 
WHERE 
  key_id = '00a93a066353f30143817c4f37cc02cb157eaa0c9245dc944d8fcce9e0962221' 
  AND (
    token = 'IQaThhvje3TFmou9AgDdzFhyVq7PVX+dlVbAyZ1Tr0Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037