UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aawYxn/4UpqTYJ4hjSuJUJUT7xWl6gQId/hmjxWfXAE=' 
WHERE 
  key_id = '87d62432a3839ed05a60f6cecd7642382e4f13adc051f5fea696b5cda4068e6f' 
  AND (
    token = 'aawYxn/4UpqTYJ4hjSuJUJUT7xWl6gQId/hmjxWfXAE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061