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

Query time 0.00025