UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ax0w8w5rlKMMFMoA4cBPW34IUntTzYOSVm/DRZXcRqw=' 
WHERE 
  key_id = '84eb0ebaaf44a3ff14c2560efd2edfa31a1d0e8a7f64228502d0a79fd7c8eb42' 
  AND (
    token = 'ax0w8w5rlKMMFMoA4cBPW34IUntTzYOSVm/DRZXcRqw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035