UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mHAJ2WRfbUTwD5uy87rOUlUKksMN8SZOdu/rN02GkSg=' 
WHERE 
  key_id = '0b60c45eda3989de0232fd43545a8e26a3597a7f89f87f5590ac88d0c9bb9276' 
  AND (
    token = 'mHAJ2WRfbUTwD5uy87rOUlUKksMN8SZOdu/rN02GkSg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054