UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hVSgRtr2BghwlEtTRgEH0q0Ine33Z/GwWvaIBwfBg0E=' 
WHERE 
  key_id = '4b15c4339dbfb6170791cd97d5a86a21a688f110c084ddea61e7fea0c19d9cca' 
  AND (
    token = 'hVSgRtr2BghwlEtTRgEH0q0Ine33Z/GwWvaIBwfBg0E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028