UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yKi1RKau6boqtKvld2uMNS/sgIpNFvUCfzd/9qmfWeU=' 
WHERE 
  key_id = '32dab3458e6901a4eb19ca681e2b34f5b892f2dad682d7d83d658df90ea2485d' 
  AND (
    token = 'yKi1RKau6boqtKvld2uMNS/sgIpNFvUCfzd/9qmfWeU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041