UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'InnIxhQIw0Hg5w9xQYkYDoSkKjNbT+W5dZaLr4PLjcw=' 
WHERE 
  key_id = '4e0122109e85118ddc154a38769ed2b104cb43456e659b3115bf799a40928f5e' 
  AND (
    token = 'InnIxhQIw0Hg5w9xQYkYDoSkKjNbT+W5dZaLr4PLjcw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030