UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5zVwBDmI8A3T8aDg5/x0NTQYynkSP9nKFTXmceaq8yc=' 
WHERE 
  key_id = '4811a207652c537568dede7802ee20c38bf27523e79fe2200eb36b3fbe12b1c4' 
  AND (
    token = '5zVwBDmI8A3T8aDg5/x0NTQYynkSP9nKFTXmceaq8yc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026