UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J1tWaZuD70nJK6XE1xYAXNf5a4WptC0rehAqt6Lufjs=' 
WHERE 
  key_id = 'e28ad03b99a9b27af078e0c8ef4b8cba824111f96708a4b95755a0a40beae8db' 
  AND (
    token = 'J1tWaZuD70nJK6XE1xYAXNf5a4WptC0rehAqt6Lufjs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020