UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yVgLiLoSllesfsCjGuEdnqPKsv8zOWXYAR5SOT0Y7WM=' 
WHERE 
  key_id = '46307f66a00f8625113127c91ba01a4a43de9258604f9514ee4bcb3bcf635b1f' 
  AND (
    token = 'yVgLiLoSllesfsCjGuEdnqPKsv8zOWXYAR5SOT0Y7WM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044