UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Inq/OwF3dJpafcBHo0sI3PyqvCgMevA2WZkz+BikeEE=' 
WHERE 
  key_id = '1be00f40e3b8556ad2046d2f4b7d684d9db5d1d45a9de75341e159f0ae335b00' 
  AND (
    token = 'Inq/OwF3dJpafcBHo0sI3PyqvCgMevA2WZkz+BikeEE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025