UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VsoCtrwJs5IDn6NWGgAWugOYZKlcSElaq5TbD6o9fFo=' 
WHERE 
  key_id = '8b39691dcadf7e4c3a5ee1ebacfd298e6773cc6b6a2d983063a45b4b41ffb5de' 
  AND (
    token = 'VsoCtrwJs5IDn6NWGgAWugOYZKlcSElaq5TbD6o9fFo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029