UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FcU4Md5lXdCDtyHPVx88G2BewZFSmNNgtGboF/cHxzA=' 
WHERE 
  key_id = '78a6047e557bfd966a67acc1134f1730dd5d82de20de961c52e3e925f8299429' 
  AND (
    token = 'FcU4Md5lXdCDtyHPVx88G2BewZFSmNNgtGboF/cHxzA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045