UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TLRkfbo8MlWcOggDVdfukbZYISZXhVvn2jszvcwFqxo=' 
WHERE 
  key_id = '88cf6dbe09e269ef01ba1164da439ed6b2b1ac92df2be23b1a4c5b140d7f431e' 
  AND (
    token = 'TLRkfbo8MlWcOggDVdfukbZYISZXhVvn2jszvcwFqxo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045