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

Query time 0.00042