UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C1WEBuy97ehQyz6A5M1/ZiS8YtAEoEwJebNyVQZO8XU=' 
WHERE 
  key_id = '2484507cc83e5b1e5970dc1a147c5f6338ae4379678ff68edf99b1efbf47a592' 
  AND (
    token = 'C1WEBuy97ehQyz6A5M1/ZiS8YtAEoEwJebNyVQZO8XU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053