UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L4llxLpAqjC8PiC3Erq1lHzJCG5fFPYGIJ4A6fnlVdM=' 
WHERE 
  key_id = '0f81bd7e559fa48c5d496bcaa9f1580460a6856e3133af9481c48de3cd78adc4' 
  AND (
    token = 'L4llxLpAqjC8PiC3Erq1lHzJCG5fFPYGIJ4A6fnlVdM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036