UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RBDy58u4EzUv+mHMwa+IuyHS22/AWn2C/mGQkLDeGHU=' 
WHERE 
  key_id = '67292924a7d4e88e8eac7dccdd90e9fa8747937fff8da72af236633e9af9a51b' 
  AND (
    token = 'RBDy58u4EzUv+mHMwa+IuyHS22/AWn2C/mGQkLDeGHU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033