UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tKkszqim6zpi7RYUc6NioQpqkPlQLWl7ZgIOLXL+I18=' 
WHERE 
  key_id = '6dcc98fa89df5b9da8796388f77f4782acdbfa13a9d40a24b1412f682e6b404b' 
  AND (
    token = 'tKkszqim6zpi7RYUc6NioQpqkPlQLWl7ZgIOLXL+I18=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029