UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0Bga0Y+Te/Vl1odynsjU+6ykqg6fg/XQVfznlbgxzwM=' 
WHERE 
  key_id = 'f7c98acea9ee418666fd625ac48bf808d7c78fd039a30646143a2641d00988cb' 
  AND (
    token = '0Bga0Y+Te/Vl1odynsjU+6ykqg6fg/XQVfznlbgxzwM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046