UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KLv3j+qm8yuAtUIjcYcQTuE6GlQGa16vGOGdTWD9QnE=' 
WHERE 
  key_id = '32073048902241996587610c677407672cb4e966af9f875077874125717e94c4' 
  AND (
    token = 'KLv3j+qm8yuAtUIjcYcQTuE6GlQGa16vGOGdTWD9QnE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052