UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '77JxkOAnl6zK5AR1dRbOEi/WAZ6YLbOK0A7XEvVQalU=' 
WHERE 
  key_id = '2874649312f69078e5d52e9b9d58fb8ac5674c37462da281caf65a6f2f8edc2a' 
  AND (
    token = '77JxkOAnl6zK5AR1dRbOEi/WAZ6YLbOK0A7XEvVQalU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036