UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'db0qYMMUVoUFx9O/ucSHzC722fUQG+VjRfg2ccdroBI=' 
WHERE 
  key_id = 'd0343cfa5f8c414458f168eee860ef73b15500fbae70707ccf06ad06f9d0fb80' 
  AND (
    token = 'db0qYMMUVoUFx9O/ucSHzC722fUQG+VjRfg2ccdroBI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042