UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GWZ6/1a6Gi8Oz6Q2omm8aIWpyaoqfK80lTU5P3yHtv8=' 
WHERE 
  key_id = '56a3d5fad62e4bfb5a459642542263d0731111fbae729e0b77c0536b56c145fe' 
  AND (
    token = 'GWZ6/1a6Gi8Oz6Q2omm8aIWpyaoqfK80lTU5P3yHtv8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017