UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mQFM25rsVMuCVZG8sxwY+YfMtZuqvPi9PfzR38Z3cUo=' 
WHERE 
  key_id = '07190bcdfdc06dfca7cfae27ed07c837a629ed656f459df96910866d720dc840' 
  AND (
    token = 'mQFM25rsVMuCVZG8sxwY+YfMtZuqvPi9PfzR38Z3cUo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017