UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nm/lz0xWwU0M3hFPzAbOuqt1ucgU/KHsbI61TvJxDqM=' 
WHERE 
  key_id = 'aa67282400727ba60ab771a7524bf57f9abc2c6145f983d545531141ab0b7d47' 
  AND (
    token = 'nm/lz0xWwU0M3hFPzAbOuqt1ucgU/KHsbI61TvJxDqM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028