UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hoZKuMspbSvgxyM2CJYeT10iFNezUP1Q+/vLc/tn5QM=' 
WHERE 
  key_id = '6a8357252f0a14c2bf4fc364eaf19009aeb0e3340be2e059350bf7c76222eaa3' 
  AND (
    token = 'hoZKuMspbSvgxyM2CJYeT10iFNezUP1Q+/vLc/tn5QM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054