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

Query time 0.00025