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

Query time 0.00035