UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LnDPNW2WRR9uQH1W9vcKnKZbi1HvaH927+OqC7rtikM=' 
WHERE 
  key_id = '236de851695efce0c1b8ab82918c60476adb1b9681760e27fc7aa343d1b8fc81' 
  AND (
    token = 'LnDPNW2WRR9uQH1W9vcKnKZbi1HvaH927+OqC7rtikM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030